package cn.itcast.hk;

public class cs {
    public static void main(String[] args) {
        //Todo 如何查看JVM的内存使用情况？
        Runtime runtime = Runtime.getRuntime();
        long max = runtime.maxMemory()/(1024*1024);
        long total = runtime.totalMemory() / (1024 * 1024);
        long free = runtime.freeMemory() / (1024 * 1024);
       long usable= max-total+free;
        System.out.println("最大内存"+max);
        System.out.println(total);
        System.out.println(free);
        System.out.println(usable);

        //0.0.00.0
    }
}
